﻿<%@ Page Language="C#" MasterPageFile="~/Shared/MainPage.Master" AutoEventWireup="true" CodeBehind="ItemGuarantyList.aspx.cs" Inherits="Runda.CMS.Portal.ContractManage.ItemGuarantyList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
    <script src="../Content/global.js" type="text/javascript"></script>
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Grid/Grid.css" rel="stylesheet" type="text/css" />
     
    <script src="../Content/Grid/map_grid.js" type="text/javascript" ></script>
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Tab/tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
      function AddGuaranty() {          
            if (document.getElementById('<%=lblItemID.ClientID %>').value == '') {
                alert('请先保存器械信息!'); return false;
            }
            openMyFullWin('ItemGuarantyAdd.aspx?ItemID=' + document.getElementById('<%=lblItemID.ClientID %>').value, 'addGuaranty');
            return false;
        }

        function OpenEditGuaranty(val) {
            openMyFullWin('ItemGuarantyAdd.aspx?ItemID=' + document.getElementById('<%=lblItemID.ClientID %>').value + '&GuarantyID=' + val, 'editGuaranty');
            return false;
        }
        function getids() {          
            var arrTr = grid.getSelected();
            if (arrTr.length > 0) {
                if (!confirm('确认删除此明细?')) {
                    return;
                }
                var ids = "";
                for (var i = 0; i < arrTr.length; i++) {
                    if (ids != "") {
                        ids += ";";
                    }
                    ids += arrTr[i].oid;
                }
                document.getElementById('<%=guarantyids.ClientID %>').value = ids;
                document.getElementById('<%=lnkbtnDelete.ClientID %>').click();
            }
        }     
        </script>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="server">

 <div class="area" id="areaForm" >                      
    <div style="margin: 5px 0 5px 0">
    </div>
                <table class="mnubar" cellspacing="0" cellpadding="0" height="400px">
                    <tbody>
                        <tr>
                            <td style="padding-left: 5px" nowrap>
                                <b>器械维修列表</b>
                            </td>
                            <td style="padding-left: 5px">
                                <img src="../Content/Grid/separator.gif">
                            </td>
                            <td class="icMenu" nowrap>
                                <span class="menu" tabindex="0" menu="appGridMenu_mainmnu">操作<img src="../Content/Grid/mnuDown.gif">
                                    <table id="appGridMenu_mainmnu" class="mnuList" cellspacing="0" cellpadding="3">
                                        <colgroup>
                                            <col class="mnuLeft">
                                            <col class="mnuItm">
                                            <col align="right" width="20">
                                            <tbody>
                                                <tr tabindex="0" action="getids()">
                                                    <td>
                                                    </td>
                                                    <td colspan="2" nowrap>
                                                        <asp:LinkButton ID="lnkbtnDelete" runat="server" OnClick="delete">删除</asp:LinkButton><input
                                                            type="hidden" runat="server" id="guarantyids" />
                                                    </td>
                                                </tr>
                                            </tbody>
                                    </table>
                                </span>
                            </td>
                            <td class="icMenu mnuRight" nowrap>
                                <span class="menu" onclick="return AddGuaranty();">
                                    <img class="mnuBtn" src="../Content/Grid/New_16_blue.gif"><span class="mnuBtn">新增维修</span></span>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
                </div>
                <asp:Repeater ID="RepeaterItemGuaranty" runat="server" 
         OnItemCommand="RepeaterItemGuaranty_ItemCommand" 
         onitemdatabound="RepeaterItemGuaranty_ItemDataBound">
                    <HeaderTemplate>
                        <table id="grid" class="grid" cellspacing="0" cellpadding="0">
                            <tbody>
                                <tr class="header">
                                    <td align="middle">
                                        <div>
                                            <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                text-align: center;">
                                                器械名称</div>
                                            <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                        </div>
                                    </td>
                                    <td align="middle">
                                        <div>
                                            <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                text-align: center;">
                                                开始时间</div>
                                            <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                        </div>
                                    </td>
                                    <td align="middle">
                                        <div>
                                            <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                text-align: center;">
                                                截止时间</div>
                                            <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                        </div>
                                    </td>
                                    <td align="middle">
                                        <div>
                                            <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                text-align: center;">
                                                保修类型</div>
                                            <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                        </div>
                                    </td>
                                    <td align="middle">
                                        <div>
                                            <div style="display: inline; float: left; height: auto; overflow: hidden; width: 96%;
                                                text-align: center;">
                                                保修状态</div>
                                            <div style="display: inline; float: right; height: auto; overflow: hidden;">
                                                <img src="../Content/Grid/bar_line.gif" border="0"></div>
                                        </div>
                                    </td>
                                  
                                    <td width="14">
                                        <asp:ImageButton ID="imgbtnRefersh" CommandName="refersh" runat="server" ImageUrl="../Content/Grid/grid_Refresh.gif"
                                            AlternateText="刷新列表" />
                                    </td>
                                </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr class="data" ondblclick="OpenEditGuaranty('<%#Eval("GuarantyID") %>')" onclick="handleClick()" oid='<%#Eval("GuarantyID") %>'>
                            <td>
                                    <asp:Label ID="lblItemID" Visible="false" runat="server" Text='<%#Eval("ItemID") %>'></asp:Label>
                                    <asp:Label ID="lblInstrumentName" runat="server"></asp:Label>
                            </td>
                            <td>
                                    <%#Eval("startDate")%>
                            </td>
                            <td>
                               <%# Eval("endDate")%>
                            </td>
                            <td>
                                <%# Eval("guarantyType").ToString() == "1"?"厂家保修":"商家保修"%>
                            </td>
                            <td>
                                <%# Eval("guarantyStatus").ToString() == "0"? "非保修": "保修"%>
                            </td>                                       
                            <td>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </tbody> </table>
                    </FooterTemplate>
                </asp:Repeater>
                <asp:TextBox ID="lblItemID" runat="server" style="display:none"></asp:TextBox>
    </div>
</asp:Content>